package com.ruoyi.ylyx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ylyx.mapper.YlyxBannerMapper;
import com.ruoyi.ylyx.domain.YlyxBanner;
import com.ruoyi.ylyx.service.IYlyxBannerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 轮播管理Service业务层处理
 * 
 * @author yuexl
 * @date 2021-02-05
 */
@Service
public class YlyxBannerServiceImpl implements IYlyxBannerService 
{
    @Autowired
    private YlyxBannerMapper ylyxBannerMapper;

    /**
     * 查询轮播管理
     * 
     * @param id 轮播管理ID
     * @return 轮播管理
     */
    @Override
    public YlyxBanner selectYlyxBannerById(String id)
    {
        return ylyxBannerMapper.selectYlyxBannerById(id);
    }

    /**
     * 查询轮播管理列表
     * 
     * @param ylyxBanner 轮播管理
     * @return 轮播管理
     */
    @Override
    public List<YlyxBanner> selectYlyxBannerList(YlyxBanner ylyxBanner)
    {
        return ylyxBannerMapper.selectYlyxBannerList(ylyxBanner);
    }

    /**
     * 新增轮播管理
     * 
     * @param ylyxBanner 轮播管理
     * @return 结果
     */
    @Override
    public int insertYlyxBanner(YlyxBanner ylyxBanner)
    {
        ylyxBanner.setId(IdWorker.getId());
        ylyxBanner.setCreateTime(DateUtils.getNowDate());
        return ylyxBannerMapper.insertYlyxBanner(ylyxBanner);
    }

    /**
     * 修改轮播管理
     * 
     * @param ylyxBanner 轮播管理
     * @return 结果
     */
    @Override
    public int updateYlyxBanner(YlyxBanner ylyxBanner)
    {
        ylyxBanner.setUpdateTime(DateUtils.getNowDate());
        return ylyxBannerMapper.updateYlyxBanner(ylyxBanner);
    }

    /**
     * 删除轮播管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYlyxBannerByIds(String ids)
    {
        return ylyxBannerMapper.deleteYlyxBannerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除轮播管理信息
     * 
     * @param id 轮播管理ID
     * @return 结果
     */
    @Override
    public int deleteYlyxBannerById(String id)
    {
        return ylyxBannerMapper.deleteYlyxBannerById(id);
    }
}
